package projeto.piloto;


import java.util.ArrayList;
import java.util.Collections;

import projeto.piloto.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;

public class RankingActivity extends Activity{
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
    	
    	
        super.onCreate(savedInstanceState);
        
        //Remove title bar
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);

        //Remove notification bar
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        
        getWindow().setSoftInputMode(
                WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
                
        setContentView(R.layout.ranking);
        
        BDRanking bd = new BDRanking();
        String out = "";
        ArrayList<String> ranking = bd.getRanking(this);
        for (int i = 0; i < ranking.size(); i++) {
			out = ranking.get(i) + "\n";
		}
        
        TextView textView = (TextView)findViewById(R.id.rankingEasy);
        textView.setText(out);
        textView.invalidate();
        
	}
	
    @Override
    public void onBackPressed() {
       Intent trocatela = new Intent(RankingActivity.this, AnagramaActivity.class);
       RankingActivity.this.startActivity(trocatela);
       RankingActivity.this.finish();
       return;
    }
    
      
}
